package com.itheima.jianbing3;

import com.itheima.jianbing2.Desk;

import java.util.concurrent.ArrayBlockingQueue;

public class Cooker implements Runnable {
    private ArrayBlockingQueue<String> queue;

    public Cooker(ArrayBlockingQueue<String> queue) {
        this.queue = queue;
    }

    @Override
    public void run() {
        //直接往里放
        for (int i=0;i<10;i++) {
            try {
                System.out.println("大爷做了一个煎饼");
                queue.put("煎饼果子");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }
}
